//
//  CourseCollectionView.h
//  Civacrm
//
//  Created by 王桂敏 on 2017/2/23.
//  Copyright © 2017年 王桂敏. All rights reserved.
//

#import <UIKit/UIKit.h>



typedef NS_ENUM(NSInteger, CourseCollectionViewType) {
    CourseCollectionViewType0,//
    CourseCollectionViewType1
};
@class CourseCollectionView;

@protocol CourseCollectionViewDelegate <NSObject>
@optional

- (void)collectionView:(CourseCollectionView *)collectionView
             didSelect:(NSInteger)index
                  type:(CourseCollectionViewType)type;


@end

@interface CourseCollectionView : UIView<UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout>

@property (nonatomic,assign) id<CourseCollectionViewDelegate> delegate;

@property (nonatomic,assign) CourseCollectionViewType type;

@property (nonatomic,assign) NSInteger col;

@property (nonatomic,strong) UICollectionView *collectionView;

@property (nonatomic,strong) UICollectionViewFlowLayout *layout;

@property (nonatomic,strong) NSMutableArray *dataSource;

@property (nonatomic,assign) NSInteger selectIndex;

- (void)setViewWithType:(CourseCollectionViewType)type
                    col:(NSInteger)col;
- (void)setViewWithDataSource:(NSMutableArray *)dataSource
                    col:(NSInteger)col;

@end
